﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace YJKRevitDimensionText.OneKeyPlanDim.DimesionDataEx
{
	public class BaseDataOper
	{
		public BaseDataOper(UIApplication uiApp)
		{
			this.m_uiApp = uiApp;
			this.m_doc = this.m_uiApp.ActiveUIDocument.Document;
			this.InitData();
		}

		public List<Grid> GetAllGrid()
		{
			return this.m_lstAllGrid;
		}

		public List<GridGroupDataEx> GetAllParallelGrid()
		{
			return this.m_lstParallelGridGroup;
		}

		public List<GridGroupDataEx> GetGridGroup()
		{
			return this.m_lstGridGroup;
		}

		public List<WallDataEx> GetOutWallData()
		{
			return this.m_lstOutWallData;
		}

		public List<WallDataEx> GetInWallData()
		{
			return this.m_lstInWallData;
		}

		public XYZ GetCenter()
		{
			return this.m_ptCenter;
		}

		private void InitData()
		{
			GridConstructor gridConstructor = new GridConstructor(this.m_doc);
			this.m_lstAllGrid = gridConstructor.GetAllGrid();
			this.m_lstGridGroup = gridConstructor.GetGridGroup();
			this.m_lstParallelGridGroup = gridConstructor.GetAllParallelGrid();
			WallDataConstructor wallDataConstructor = new WallDataConstructor(this.m_uiApp);
			this.m_lstOutWallData = wallDataConstructor.GetOutWallData();
			this.m_lstInWallData = wallDataConstructor.GetInWallData();
			this.m_ptCenter = wallDataConstructor.GetCenter();
		}

		private List<Grid> m_lstAllGrid = new List<Grid>();

		private List<GridGroupDataEx> m_lstParallelGridGroup = new List<GridGroupDataEx>();

		private List<GridGroupDataEx> m_lstGridGroup = new List<GridGroupDataEx>();

		private List<WallDataEx> m_lstOutWallData = new List<WallDataEx>();

		private List<WallDataEx> m_lstInWallData = new List<WallDataEx>();

		private XYZ m_ptCenter;

		private Document m_doc;

		private UIApplication m_uiApp;
	}
}
